# URLify: Write a method to replace all spaces in a string with'%20'You may assume that the string
# has sufficient space at the end to hold the additional characters, and that you are given the "true"
# length of the string, (Note: if implementing in Java, please use a character array so that you can
# perform this operation in place.)

def URLify(s1):
    res = []
    for x in range(len(s1)):
        if s1[x] == ' ':
            res.append('%')
            res.append('2')
            res.append('0')
        else:
            res.append(s1[x])
    return ''.join(res)

print(URLify('Hello World'))